#ifndef REGGRAMMATICA_H_
#define REGGRAMMATICA_H_

#include <iostream>
#include <ostream>
#include <list>
#include <string>
#include <iterator>
#include <assert.h>
#include "ProductionRule.h"

using namespace std;

template<class DataType>
class RegGrammatica
{
private:
	list<DataType> nonTerminals;						//Hulpsymbolen
	list<char> alphabet;								//Letter Sigma
	list<ProductionRule<DataType> > productionRules;	//Productionrules
	DataType startSymbol;								//Start Symbol
	void generateWords(unsigned int maxSize, const DataType & currentNonTerm, const string &word, list<DataType> &language);
public:
	RegGrammatica();
	RegGrammatica(list<DataType> helpSymbols, list<char> alphabet, list<ProductionRule <DataType> > productionRules, DataType startSymbol);
	RegGrammatica(list<ProductionRule<DataType> > productionRules, DataType startSymbol);
	static void prodLine(ostream &os, const list<ProductionRule<DataType> >& allRules);
	virtual ~RegGrammatica();
	list<DataType> getLanguage(int maxSteps);
	list<DataType> getNonTerminals();
	list<char> getAlphabet();
	list<ProductionRule<DataType> > getProductionRules();
	DataType getStartSymbol();
	list<string> sort(list<string> &sourceList);
	void printLanguage(int count);
	void printProdRules();
};
#include "regGrammatica.cpp"
#endif


